<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>销售机会编辑</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/client/style.css" type="text/css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/admin-all.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
<script src="${pageContext.request.contextPath}/js/layui/layui.all.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery/jquery-3.3.1.js"></script>

    <script type="text/javascript">
        $(function () {
            var date = new Date();
            var year = date.getFullYear();
            var month = date.getMonth()+1;//js中是从0开始所以要加1
            var day = date.getDate();
            var hour = date.getHours();
            var minute = date.getMinutes();
            var second = date.getSeconds();

           // alert(year+'年'+month+'月'+day+'日 '+hour+':'+minute+':'+second);
            var now = year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
          /*  $("#create_time").val(now);
            $("#assignment_time").val(now);*/
        });
    </script>
    <script type="text/javascript">
        $(function () {
            var msg = $("#msg").val();
            if (msg == "修改成功!") {
                layer.alert(msg);
                setTimeout(go,2000);
                function go(){
                    window.location.href="queryChance";
                }
            }
        });
    </script>

    <script type="text/javascript">
        function checkNull() {
            var cusname = $("#customer_name").val();
            var summarize = $("#summarize").val();
            if(cusname.trim()=="" || summarize.trim()==""){

                layer.alert("客户名称和概要不允许为空!");
                return false;
            }
            return true;
        }
    </script>

</head>
<body>
<div class="alert alert-info">销售机会管理<b class="tip"></b>编辑销售机会</div>
<input type="hidden" id="msg" value="${msg}"/>

<form action="updateInfo" method="post">
<div class="button_bar">
    <input type="button" class="common_button" onclick="alert('欢迎使用!');" value="帮助"/>
	<input type="button" class="common_button" onclick="window.history.go(-1);" value="返回"/>
	<input type="submit" class="common_button"  value="保存" onClick="return checkNull()"/>
</div>
<c:forEach items="${pageInfo.list}" var="sale" varStatus="status">
<table class="query_table">
	<tr>
		<th>编号</th>
		<td><input type="text" name="id" size="20" readonly value="${sale.id}" /></td>
		<th>机会来源</th>
		<td>
			<input type="text" name="opportunity_source" size="20" value="${sale.opportunity_source}"/></td>
	</tr>
	<tr>
		<th>客户名称</th>
		<td><input type="text" name="customer_name" id="customer_name" size="20" value="${sale.customer_name}"/><span class="red_star">*</span></td>
		<th>成功机率(%)</th>
		<td><input type="text" name="success_probability" size="20" value="${sale.success_probability}"/><span class="red_star">*</span></td>
	</tr>	
	<tr>
		<th>概要</th>
		<td colspan="3"><input type="text" name="summarize" id="summarize" size="50" value="${sale.summarize}"/><span class="red_star">*</span></td>
	</tr>
	<tr>
		<th>联系人</th>
		<td><input type="text" name="linkman" size="20" value="${sale.linkman}"/></td>
		<th>联系人电话</th>
		<td><input type="text" name="link_tel" size="20" value="${sale.link_tel}"/></td>
	</tr>
	<tr>
		<th>机会描述</th>
		<td colspan="3"><textarea name="opportunity_desc" rows="6" cols="50" value="${sale.opportunity_desc}"></textarea><span class="">*</span></td>
	</tr>
	<tr>
		<th>创建人</th>
		<td><input type="text" name="creator" size="20"  value="${sale.creator}" readonly /><span class="red_star">*</span></td>
		<th>创建时间</th>
		<td><input type="text" name="create_time" id="create_time" name="create_time" size="20"  value="${sale.create_time}" readonly /><span class="red_star">*</span></td>
	</tr>
</table>
</br>
<table disabled class="query_table" id="table1">
	<tr>
		<th>指派给</th>
		<td>
            <select name="designator">
                <option name="designator" value="">请选择...</option>
                <option name="designator" value="张三"   <c:if test='${sale.designator == "张三"}'> selected='selected'</c:if>  >张三</option>
                <option name="designator" value="李四"   <c:if test='${sale.designator == "李四"}'> selected='selected'</c:if>  >李四</option>
                <option name="designator" value="王五"   <c:if test='${sale.designator == "王五"}'> selected='selected'</c:if>  >王五</option>
            </select> <span class="red_star">*</span></td>
		<th>指派时间</th>
		<td>
			<input  type="text" name="assignment_time" size="20" id="assignment_time" name="assignment_time" value="${sale.assignment_time}" readonly /><span class="red_star">*</span></td>
			
	</tr>
</table>
</c:forEach>
</form>
</body>
</html>
